#ifndef ACCOUNT_HH
#define ACCOUNT_HH

#include <string>
#include <vector>
#include "Transaction.hh"
#include "main.hh"

class Customer; // Forward declaration

class Account {
protected:
    std::string accountId;
    Customer* accountHolder;
    double balance;
    std::vector<Transaction> transactions;
    std::string accountType;

public:
    Account(const std::string& id, Customer* holder, double initialBalance, const std::string& type);
    virtual ~Account() = default;

    // Getters
    std::string getAccountId() const;
    Customer* getAccountHolder() const;
    double getBalance() const;
    const std::vector<Transaction>& getTransactions() const;
    std::string getAccountType() const;

    // Common functionality
    virtual void deposit(double amount, const std::string& note = "") = 0;
    virtual void withdraw(double amount, const std::string& note = "") = 0;
    virtual void transfer(Account* destination, double amount, const std::string& note = "") = 0;
    void addTransaction(const Transaction& transaction);
    void addTransaction(double amount, const std::string& type, const std::string& note = "");

    // Display functions
    virtual void displayAccountInfo() const = 0;
    virtual void displayTransactionHistory() const;
    void generateAccountReport(const std::string& filename) const;

    // Static function to generate account ID
    static std::string generateAccountId(const std::string& accountType);
};

#endif // ACCOUNT_HH